# -*- coding: utf-8  -*-
#!/usr/local/bin/python

# from misc.backend import BaseManager
# from cm.privilege.constants import CommodityOrderType
# from cm.privilege.models import Channel

__author__ = 'jian.yao'


# class CommodityManage(BaseManager):
#     def __init__(self):
#         _order_type =  CommodityOrderType
#         BaseManager.__init__(self, _model=Channel, _order_type=_order_type)
#
#     def __save__(self, _object, _commit=True, **kwargs):
#         if not _object:
#             return None
#
#         if '_name' in kwargs:
#             _object.name = kwargs['_name']
#         if '_img_url' in kwargs:
#             _object.img_url = kwargs['_img_url']
#         if '_price' in kwargs:
#             _object.price = kwargs['_price']
#         if '_left_count' in kwargs:
#             _object.left_count = kwargs['_left_count']
#         if 'description' in kwargs:
#             _object.description = kwargs['description']
#
#         if _commit:
#             _object.save()
#
#         return _object


